package com.rico.kok.tool;

import java.util.Random;

//生成随机盐值
public class SaltUtils {

    public static String getSalt(int n){
        char[] chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+-=".toCharArray();
        StringBuffer stringBuffer=new StringBuffer();
        for (int i = 0; i < n; i++) {
            char aChar=chars[new Random().nextInt(chars.length)];
            stringBuffer.append(aChar);
        }
        return stringBuffer.toString();
    }
}
